package com.nameli.admin.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author NAME-L
 * @Description 跨域请求
 * @className CrosConfig
 * @date 2021-11-03 10:53:14
 */
//@Configuration
public class CrossConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
//        registry.addMapping("/**")
//                .allowedOrigins("*")
//                .allowedMethods("GET","HEAD","POST","DELETE","OPTIONS","PUT")
//                .allowCredentials(true)
//                .maxAge(3600)
//                .allowedHeaders("*");
    }
}
